<style scoped>

</style>
<template>
  <MyLayout>
    <Button type="info" @click="getUserInfo">获取用户信息</Button>
    <Table :columns="columns1" :data="data1"></Table>
  </MyLayout>
</template>
<script>

  import {star,getDemoName} from "@/utils/service"
  import MyLayout from '@/components/MyLayout'
  export default {
    components: {MyLayout},
    data () {
      return {
        columns1: [
          {
            title: 'Name',
            key: 'name'
          },
          {
            title: 'Age',
            key: 'age'
          },
          {
            title: 'Address',
            key: 'address'
          }
        ],
        data1: [
          {
            name: 'John Brown',
            age: 18,
            address: 'New York No. 1 Lake Park',
            date: '2016-10-03'
          },
          {
            name: 'Jim Green',
            age: 24,
            address: 'London No. 1 Lake Park',
            date: '2016-10-01'
          },
          {
            name: 'Joe Black',
            age: 30,
            address: 'Sydney No. 1 Lake Park',
            date: '2016-10-02'
          },
          {
            name: 'Jon Snow',
            age: 26,
            address: 'Ottawa No. 2 Lake Park',
            date: '2016-10-04'
          }
        ]
      }
    },
    methods: {
      getUserInfo () {
        this.axios.get("http://localhost:8390/api/user/info").then(response=>{
          console.log(response.data)
          console.log(response.headers.token) //来自服务端下发的token


        })

      }
    },
    created () {

    }
  }
</script>
